import { useDispatch,useSelector,  } from 'react-redux';
import { increment, decrement, addToNum } from "./store/modules/counterStore.js";
import { useEffect } from "react";

export default function ReduxTest() {
  const { count } = useSelector(state => state.counter)
  const channelStore = useSelector(state => state.channel)

  const dispatch = useDispatch();

  useEffect(() => {
    // dispatch(fetchChannelList())
  })
  console.log(channelStore)
  return (
    <div>
      <button onClick={() => dispatch(decrement())}>-</button>
      <div>{count}</div>
      <button onClick={() => dispatch(increment())}>+</button>
      <button onClick={() => dispatch(addToNum(2))}>++</button>
    </div>
  )
}